<html>
<head><meta charset="utf-8"><title>misoptimization · t-compiler/wg-llvm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/index.html">t-compiler/wg-llvm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/misoptimization.html">misoptimization</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="184141283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/misoptimization/near/184141283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/misoptimization.html#184141283">(Dec 24 2019 at 00:12)</a>:</h4>
<p>Do we have a process for filing upstream LLVM bugs? I've translated <a href="https://rust.godbolt.org/z/8_BeVD" target="_blank" title="https://rust.godbolt.org/z/8_BeVD">this Rust</a> to this <a href="https://c.godbolt.org/z/-FBzNe" target="_blank" title="https://c.godbolt.org/z/-FBzNe">C</a>. In either case, I expect that the <code>please_delete</code> function is not called, as it's statically obvious that that branch cannot be reached. GCC successfully removes the call (compiling bar to <code>ret</code>).</p>



<a name="184144111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/misoptimization/near/184144111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/misoptimization.html#184144111">(Dec 24 2019 at 01:20)</a>:</h4>
<p>Interestingly, if the <code>len_utf8</code> function is marked as <code>inline(never)</code> the problem disappears</p>



<a name="184144112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/misoptimization/near/184144112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/misoptimization.html#184144112">(Dec 24 2019 at 01:21)</a>:</h4>
<p>which is.. not intuitive</p>



<a name="184157937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/misoptimization/near/184157937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/misoptimization.html#184157937">(Dec 24 2019 at 08:35)</a>:</h4>
<p>To be clear, the problem here is that an optimization which would be correct and desirable does not happen? I ask because "misoptimization" (like "miscompile") usually refers to an optimization being incorrect, changing the behavior of the program.</p>



<a name="184176242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/misoptimization/near/184176242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/misoptimization.html#184176242">(Dec 24 2019 at 15:52)</a>:</h4>
<p><span class="user-mention" data-user-id="124289">@rkruppe</span> yep, not a case of miscompilation here</p>



<a name="184677617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/misoptimization/near/184677617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/misoptimization.html#184677617">(Jan 02 2020 at 19:35)</a>:</h4>
<p>maybe better topic title would be "missed optimization" ?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>